步骤：
1.安装telnet
2.添加安全终端
3.修改ssh配置文件

1.安装telnet：

yum -y install telnet telnet-server xinetd
#yum安装telnet

systemctl enable xinetd.service
#设置xinetd开机自启

systemctl enable telnet.socket
#设置telnet开机自启

systemctl start telnet.socket
systemctl start xinetd
#启动telnet服务

netstat -antupl | grep 23
#查看telnet服务是否启动

2.添加安全终端：
对于“Telnet连接报错：Login incorrect”的问题，需要进行如下操作：



[root@wh-dev-ac01 ~]# cat /etc/pam.d/login 
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so <--此行需要注视掉

service xinetd restart
#重启Telnet服务

~]# tail -n 20 /var/log/secure
~]# vi /etc/securetty
#找到登陆不成功的终端，加入到安全终端内

3.修改ssh配置文件

首先查看ssh的版本，
~]# ssh -V
如果版本是7.3及以下：
        修改/etc/ssh/sshd_config中 UseLogin的值为yes
        UseLogin yes后:
                        重启sshd服务service sshd restart即可。

如果版本是7.4及以上，
具体步骤如下：
        1、修改/etc/ssh/sshd_config的
                                        UsePAM no为
                                        UsePAM yes
        2、修改/etc/pam.d/sshd以及/etc/pam.d/password-auth为之前版本的文件。
                具体文件内容如下：

#/etc/pam.d/sshd 内容如下:

auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth

#/etc/pam.d/password-auth内容如下：
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3 type=
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so

#重启sshd
service sshd restart